#ifndef ELEMENT_H
#define ELEMENT_H

#include <list>
#include <iostream>
#include <string>

#include "attr_node.h"

// Resolve circular dependency issue caused by the
// bi-directionnal association between Node and Element
class Node;

class XmlElement : public AttrNode {

public:
	
	XmlElement();
	XmlElement(const XmlElement& e);
	XmlElement(std::string tag);
	XmlElement(std::string tag, std::string ns);
	
	virtual ~XmlElement();
	
	void addChild (Node *node);
	void removeChild (Node *node);
	void setChildren(std::list<Node*> *children);
	std::list<Node*>* getChildren();
	virtual void print(std::ostream& out);
	virtual XmlElement* clone() const;

	// Cast a Node to an Element.
	// returns NULL if cast fails
	static XmlElement* getElement(Node *node);
	
protected:

	std::list<Node*> *mChildren;
};


 #endif //ELEMENT_H
